Skip to content

fix(operator): rename BackendAuthType enum value to camelCase#4563

Open
tmchow wants to merge 6 commits intostacklok:mainfrom
tmchow:fix/rename-backend-auth-type-camelcase
Open

fix(operator): rename BackendAuthType enum value to camelCase#4563
tmchow wants to merge 6 commits intostacklok:mainfrom
tmchow:fix/rename-backend-auth-type-camelcase

Conversation

@tmchow
Copy link
Copy Markdown
Contributor

@tmchow tmchow commented Apr 4, 2026

The enum value `external_auth_config_ref` was the only snake_case type discriminator in the CRD codebase. Every other value uses camelCase (`tokenExchange`, `headerInjection`, `bearerToken`, `embeddedAuthServer`, `awsSts`, etc.). Renamed to `externalAuthConfigRef` for consistency before the API moves past v1alpha1.

Changes:

  • Renamed the constant string value in `virtualmcpserver_types.go`
  • Updated kubebuilder validation Enum markers and CEL validation rules
  • Updated all test fixtures across 5 test files
  • Regenerated CRD manifests and API docs

Build, lint (0 issues), and compilation all pass.

Fixes #4542

@jerm-dro jerm-dro self-requested a review April 6, 2026 14:51
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Apr 6, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.79%. Comparing base (443d2fa) to head (792009b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/thv-operator/pkg/vmcpconfig/converter.go 22.22% 6 Missing and 1 partial ⚠️
...hv-operator/api/v1alpha1/virtualmcpserver_types.go 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4563      +/-   ##
==========================================
+ Coverage   68.78%   68.79%   +0.01%     
==========================================
  Files         516      516              
  Lines       54307    54320      +13     
==========================================
+ Hits        37353    37371      +18     
+ Misses      14100    14088      -12     
- Partials     2854     2861       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 6, 2026
@tmchow
Copy link
Copy Markdown
Contributor Author

tmchow commented Apr 8, 2026

Ran controller-gen for both operator-generate and operator-manifests -- no changes produced, so the generated files are already in sync.

The deprecation warning is in converter.go and fires when the old external_auth_config_ref value is used. Using log.Info since controller-runtime's logr doesn't have a Warn level, but happy to switch to a different approach if you prefer.

@tmchow tmchow force-pushed the fix/rename-backend-auth-type-camelcase branch from f831f0b to 2571582 Compare April 10, 2026 02:09
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 10, 2026
tmchow added 5 commits April 10, 2026 14:18
The enum value "external_auth_config_ref" was the only snake_case
discriminator in the CRD codebase. All other values use camelCase
(tokenExchange, headerInjection, bearerToken, etc.). This renames
it to "externalAuthConfigRef" for consistency before the API
stabilizes.

Updated the constant, kubebuilder validation markers, CEL rules,
converter logic, and all test fixtures. CRD manifests and API
docs regenerated.

Fixes stacklok#4542
Keep the old "external_auth_config_ref" value as
DeprecatedBackendAuthTypeExternalAuthConfigRef so existing CRDs
continue to validate. The kubebuilder enum and validation switch
now accept both the new camelCase and deprecated snake_case values.
@tmchow tmchow force-pushed the fix/rename-backend-auth-type-camelcase branch from 2571582 to 276a139 Compare April 10, 2026 21:18
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 10, 2026
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename BackendAuthType external_auth_config_ref to camelCase

3 participants